how to make pattern with python